package org.edu.modules.stu.base.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.edu.common.base.BasePageDto;
import org.edu.modules.stu.base.entity.VeStuFamily;
import org.edu.modules.stu.base.dto.VeStuFamilyDto;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;

/**
 * dao-家庭成员管理
 */
public interface VeStuFamilyMapper extends BaseMapper<VeStuFamily> {
    /**
     * 查询DTO 的分页
     **/
    IPage<VeStuFamilyDto> pageDto(BasePageDto page, @Param(Constants.WRAPPER) Wrapper queryWrapper);

    @Delete("delete from ve_stu_family where stu_id=#{stuId}")
    void deleteByStuId(@Param("stuId") Integer stuId);
    @Select("select name from ve_base_dict_area where id = #{id}")
    String getDictAreaNameById(@Param("id") Integer id);
    @Select("select id from ve_base_dict_area where name = #{name} and pid = #{pid}")
    Integer getDictIdByNameAndPid(@Param("pid")Integer pid,@Param("name")String name);
}
